package com.jiuling.apis.service.demo;


import com.jiuling.apis.interfaces.DubboServiceI;
import com.jiuling.apis.model.Hmodel.Temp;
import com.jswzc.dao.hdao.BaseDaoI;
import com.jswzc.dao.mdao.DaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;


/**
 * Created by liujiajia on 2017/5/9.
 */
@Service("dubboService")
public class DubboServiceImpl implements DubboServiceI {
    @Resource(name = "daoSupport")
    private DaoSupport dao;

    @Autowired
    private BaseDaoI<Temp> tempDao;

    @Override
    public String testConnect() {
        Temp temp=new Temp();
        temp.setId("11111");
        temp.setName("2222");
        tempDao.save(temp);
        return "999999999999";
    }

    @Override
    public List<HashMap> testDmeo() throws Exception{
        return (List<HashMap>) dao.findForList("demoDao.showGrid", null);
    }

    @Override
    @Transactional
    public String saveDemo() throws Exception {
        Temp temp=new Temp();
        temp.setId("11111");
        temp.setName("2222");
        tempDao.save(temp);
        return "999999999999";
    }
}
